#include <stdio.h>
#include <string.h>

int main()
{
	int arr[100] = { 0 };
	int arr2[100] = { 0 };
	int n = 0, i = 0, k = 0, min = 1000, j = 0, m = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	scanf("%d", &m);
	for (j = 0;j < n;j++)
	{
		for (i = 0; i < n; i++)
		{
			min = min < arr[i] ? min : arr[i];
		}
		for (i = 0; i < n; i++)
		{
			if (arr[i] == min)
			{
				arr2[k] = arr[i];
				arr[i] = 1000;
			}
		}
		k++;
		min = 1000;
	}
	int sz = 0;
	for (i = 0; i < k; i++)
	{
		if (arr2[i] != 1000)
		{
			sz++;
		}
	}
	printf("%d\n", arr2[sz-m]);
	return 0;
}
